package com.tuanzi.loan.business.service.receipt.statistics.impl;

import com.tuanzi.loan.business.entity.receipt.statistics.ReceiptRechargeStatistics;
import com.tuanzi.loan.business.repository.receipt.statistics.ReceiptRechargeStatisticsRepository;
import com.tuanzi.loan.business.service.receipt.statistics.ReceiptRechargeStatisticsService;
import com.tuanzi.loan.core.aspect.Debug;
import com.tuanzi.loan.core.service.CommonServiceImpl;
import com.tuanzi.loan.core.vo.PageSearcher;
import com.tuanzi.loan.vo.request.receipt.statistics.ReceiptRechargeStatisticsSearchRequest;
import com.tuanzi.loan.vo.response.receipt.statistics.ReceiptRechargeStatisticsSearchResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * @author lsx
 */
@Debug
@Service
@Transactional
public class ReceiptRechargeStatisticsServiceImpl extends CommonServiceImpl<ReceiptRechargeStatistics, Long> implements ReceiptRechargeStatisticsService {

    @Autowired
    private ReceiptRechargeStatisticsRepository rechargeStatisticsRepository;

    @Override
    protected JpaRepository<ReceiptRechargeStatistics, Long> getRepository() {
        return rechargeStatisticsRepository;
    }

    @Override
    public Page<ReceiptRechargeStatisticsSearchResponse> list(PageSearcher<ReceiptRechargeStatisticsSearchRequest> pageSearcher) {
        return rechargeStatisticsRepository.list(pageSearcher.getSearchCondition(), pageSearcher.getPageable());
    }

}
